﻿<UserControl x:Class="SLAdmin.UserControls.EditStudies"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:extended="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
    xmlns:images="clr-namespace:SLAdmin.Images"    
    xmlns:extensions="clr-namespace:SLExtensions.Controls;assembly=SLExtensions.Controls"    
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
             LayoutUpdated="UserControl_LayoutUpdated"
             >
    <Grid x:Name="LayoutRoot" Style="{StaticResource MainDockBackground2}">
        <extensions:DockPanel x:Name="LayoutDock"                               
                              >          
            <Grid extensions:DockPanel.Dock="Top">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="130" />
                    <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0" Margin="10"  Source="icons/db-128.png" />
                <TextBlock Grid.Column="1" Height="40" Margin="0,0,5,0"
                           FontSize="23" Text="Studies" VerticalAlignment="Center"/>
            </Grid>  
            <extensions:DockPanel Style="{StaticResource DockMainTabPage}">
                        <Border extensions:DockPanel.Dock="Bottom" Style="{StaticResource BorderTabBottomPanel}">
                            <Button x:Name="btnNewStudy" 
                                    Style="{StaticResource ButtonMedium}"
                                    Click="btnNewStudy_Click">
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="icons/studyicon.png"/>
                                    <TextBlock Text="New Study" 
                                           Margin="5,0,0,0" 
                                           VerticalAlignment="Center" />    
                                </StackPanel>
                            </Button>
                        </Border>
                        <ScrollViewer Style="{StaticResource ScrollViewerTabWindow}">
                            <StackPanel Orientation="Vertical">
                                <data:DataGrid x:Name="StudyGrid"
                                               AutoGenerateColumns="False"
                                                
                                                HeadersVisibility="Column"
                                                RowBackground="White"
                                                AlternatingRowBackground="LightGray"
                                                CanUserResizeColumns="False"                                                
                                                RowHeight="45">
                                    <data:DataGrid.Columns>
                                        <data:DataGridTemplateColumn Width="30">
                                            <data:DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <Image Source="icons/StudyIcon.png" Margin="3" />
                                                </DataTemplate>
                                            </data:DataGridTemplateColumn.CellTemplate>
                                        </data:DataGridTemplateColumn>
                                        <data:DataGridTextColumn MinWidth="200" Width="Auto" 
                                                                 Binding="{Binding StudyName, Mode=TwoWay}"/>
                                        <data:DataGridTemplateColumn Width="50" MinWidth="50">
                                            <data:DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <Button Margin="3" Click="btnStudyDelete_Click"
                                                        x:Name="btnStudyDelete">
                                                        <images:DeleteIcon/>
                                                    </Button>
                                                </DataTemplate>
                                            </data:DataGridTemplateColumn.CellTemplate>
                                        </data:DataGridTemplateColumn>
                                    </data:DataGrid.Columns>
                                </data:DataGrid>
                            </StackPanel>
                        </ScrollViewer>
                    </extensions:DockPanel>               
        </extensions:DockPanel>
    </Grid>
</UserControl>
